package com.hnchances.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 
 * @TableName user
 */
@TableName(value ="user")
@Data
public class User implements Serializable {
    /**
     * id自增，key
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    @TableField(value = "userName")
    private String userName;

    /**
     * 密码，md5
     */
    @TableField(value = "passWord")
    private String passWord;

    /**
     * 电话号码11位
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 真实姓名
     */
    @TableField(value = "trueName")
    private String trueName;

    /**
     * 0-学生，1-老师，2-领导或管理（可看所有班级）
     */
    @TableField(value = "identity")
    private Integer identity;

    /**
     * 班级关联ID
     */
    @TableField(value = "classID")
    private Integer classID;

    /**
     * 课程ID
     */
    @TableField(value = "courseID")
    private Integer courseID;

    /**
     * 学生ID
     */
    @TableField(value = "studentID")
    private Integer studentID;

    /**
     * 注册日期
     */
    @TableField(value = "creatDateTime")
    private LocalDateTime creatDateTime;

    /**
     * 修改日期
     */
    @TableField(value = "updateDateTime")
    private LocalDateTime updateDateTime;

    /**
     * 最后登录时间
     */
    @TableField(value = "lastLoginDateTime")
    private LocalDateTime lastLoginDateTime;

    /**
     * ipv4
     */
    @TableField(value = "loginIP")
    private String loginIP;

    /**
     * 修改人ID
     */
    @TableField(value = "updateByID")
    private Long updateByID;

    /**
     * 0-正常，1-删除
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 0-未审核,1-审核
     */
    @TableField(value = "verify")
    private Integer verify;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getPassWord() == null ? other.getPassWord() == null : this.getPassWord().equals(other.getPassWord()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getTrueName() == null ? other.getTrueName() == null : this.getTrueName().equals(other.getTrueName()))
            && (this.getIdentity() == null ? other.getIdentity() == null : this.getIdentity().equals(other.getIdentity()))
            && (this.getClassID() == null ? other.getClassID() == null : this.getClassID().equals(other.getClassID()))
            && (this.getCourseID() == null ? other.getCourseID() == null : this.getCourseID().equals(other.getCourseID()))
            && (this.getStudentID() == null ? other.getStudentID() == null : this.getStudentID().equals(other.getStudentID()))
            && (this.getCreatDateTime() == null ? other.getCreatDateTime() == null : this.getCreatDateTime().equals(other.getCreatDateTime()))
            && (this.getUpdateDateTime() == null ? other.getUpdateDateTime() == null : this.getUpdateDateTime().equals(other.getUpdateDateTime()))
            && (this.getLastLoginDateTime() == null ? other.getLastLoginDateTime() == null : this.getLastLoginDateTime().equals(other.getLastLoginDateTime()))
            && (this.getLoginIP() == null ? other.getLoginIP() == null : this.getLoginIP().equals(other.getLoginIP()))
            && (this.getUpdateByID() == null ? other.getUpdateByID() == null : this.getUpdateByID().equals(other.getUpdateByID()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getVerify() == null ? other.getVerify() == null : this.getVerify().equals(other.getVerify()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getPassWord() == null) ? 0 : getPassWord().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getTrueName() == null) ? 0 : getTrueName().hashCode());
        result = prime * result + ((getIdentity() == null) ? 0 : getIdentity().hashCode());
        result = prime * result + ((getClassID() == null) ? 0 : getClassID().hashCode());
        result = prime * result + ((getCourseID() == null) ? 0 : getCourseID().hashCode());
        result = prime * result + ((getStudentID() == null) ? 0 : getStudentID().hashCode());
        result = prime * result + ((getCreatDateTime() == null) ? 0 : getCreatDateTime().hashCode());
        result = prime * result + ((getUpdateDateTime() == null) ? 0 : getUpdateDateTime().hashCode());
        result = prime * result + ((getLastLoginDateTime() == null) ? 0 : getLastLoginDateTime().hashCode());
        result = prime * result + ((getLoginIP() == null) ? 0 : getLoginIP().hashCode());
        result = prime * result + ((getUpdateByID() == null) ? 0 : getUpdateByID().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getVerify() == null) ? 0 : getVerify().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userName=").append(userName);
        sb.append(", passWord=").append(passWord);
        sb.append(", phone=").append(phone);
        sb.append(", trueName=").append(trueName);
        sb.append(", identity=").append(identity);
        sb.append(", classID=").append(classID);
        sb.append(", courseID=").append(courseID);
        sb.append(", studentID=").append(studentID);
        sb.append(", creatDateTime=").append(creatDateTime);
        sb.append(", updateDateTime=").append(updateDateTime);
        sb.append(", lastLoginDateTime=").append(lastLoginDateTime);
        sb.append(", loginIP=").append(loginIP);
        sb.append(", updateByID=").append(updateByID);
        sb.append(", status=").append(status);
        sb.append(", verify=").append(verify);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}